Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Data
Imports System.Text
Imports System.Windows.Forms
Imports System.Drawing.Drawing2D
Imports System.Globalization


Namespace DgvFilterPopup

	''' <summary>
	''' Is the standard implementation of DgvBaseFilterHost
	''' </summary>
	<ToolboxItem(False)> _
	Public Partial Class DgvFilterHost
		Inherits DgvBaseFilterHost

		''' <summary>
		''' Initializes a new instance of the <see cref="DgvFilterHost"/> class.
		''' </summary>
		Public Sub New()
			InitializeComponent()
            AddHandler Me.CurrentColumnFilterChanged, New EventHandler(AddressOf DgvFilterHost_CurrentColumnFilterChanged)
		End Sub

		Private Sub DgvFilterHost_CurrentColumnFilterChanged(sender As Object, e As EventArgs)
			lblColumnName.Text = CurrentColumnFilter.OriginalDataGridViewColumnHeaderText
		End Sub

		''' <summary>
		''' Return the effective area to which the <i>column filters</i> will be added.
		''' </summary>
		''' <value></value>
		Public Overrides ReadOnly Property FilterClientArea() As Control
			Get
				Return Me.panelFilterArea
			End Get
		End Property

		Private Sub tsOK_Click(sender As Object, e As EventArgs)
			FilterManager.ActivateFilter(True)
			Me.Popup.Close()
		End Sub

		Private Sub tsRemove_Click(sender As Object, e As EventArgs)
			FilterManager.ActivateFilter(False)
			Me.Popup.Close()
		End Sub

		Private Sub tsRemoveAll_Click(sender As Object, e As EventArgs)
			FilterManager.ActivateAllFilters(False)
			Me.Popup.Close()
		End Sub


	End Class
End Namespace
